import { defHttp } from '@/utils/http/axios';
import { IOrderListResult, ITicketOrder } from './type';

enum Api {
  orderList = '/admin/op/member-paymenrecord/pageList',
  orderDetail = '/admin/op/member-paymenrecord/getById',
  activityTicketOrderList = '/admin/op/activity-ticket/order/pageList',
  activityTicketOrderDetail = '/admin/op/activity-ticket/order/getById'
}

/**
 * @description 会费订单
 * @date
 * @export
 * @param
 */
export function OrderList(params) {
  return defHttp.get<IOrderListResult>({
    url: Api.orderList,
    params,
  });
}

/**
 * @description 订单详情
 * @date
 * @export
 * @param
 */
export function OrderDetail(id) {
  return defHttp.get({
    url: Api.orderDetail + `/${id}`,
  });
}

/**
 * 活动票订单
 * @param params 
 * @returns 
 */
export function getActivityTicketOrderList(params) {
  return defHttp.get<ITicketOrder>({
    url: Api.activityTicketOrderList,
    params,
  });
}

/**
 * 活动票订单详情
 * @param id 
 * @returns 
 */
export function getActivityTicketOrderDetail(id) {
  return defHttp.get({
    url: Api.activityTicketOrderDetail + `/${id}`,
  });
}